
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)

project(signal LANGUAGES C)

include_directories(../common)

set(COMPILE_ALL OFF)

list(APPEND _sources
    ../common/error.c
    ../common/prexit.c
    ../common/lockfile.c
    ../common/setfd.c
    ../common/setfl.c
    ../common/clrfl.c
    ../common/lockreg.c
    ../common/locktest.c
    ../common/tellwait.c
    ../common/daemonize.c
    ../common/servlisten.c
    ../common/servaccept.c
    ../common/cliconn.c
    ../common/sendfd.c
    ../common/senderr.c
    ../common/recvfd.c
    ../common/writen.c
    # ../common/errorlog.c
#05_sendfd2.c
    #06_recvfd2.c
    03_ctermid.c
    04_isatty.c
    06_ttyname.c
    08_getpass.c
    ../common/ttymodes.c
)

if (COMPILE_ALL)
add_executable(settty 01_settty.c ${_sources})
add_executable(csize 02_csize.c ${_sources})
add_executable(t_isatty 05_t_isatty.c ${_sources})
add_executable(t_ttyname 07_t_ttyname.c ${_sources})
add_executable(t_getpass 09_t_getpass.c ${_sources})
add_executable(t_raw 10_t_raw.c ${_sources})

else()
add_executable(winch 11_winch.c ${_sources})
endif()
